package com.manlitech.cloudboot.clickhouse.controller;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.manlitech.cloudboot.clickhouse.pojo.UserInfo;
import com.manlitech.cloudboot.clickhouse.service.UserInfoService;
import com.manlitech.cloudboot.common.utils.Result;
import com.manlitech.cloudboot.common.utils.ResultUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author shensg
 * @date 2021/7/23 14:04
 */
@RestController
public class UserInfoController {
    @Autowired
    UserInfoService userInfoService;

    @GetMapping("/selectById/{id}")
    public UserInfo selectById(@PathVariable("id") Integer id) {
        return userInfoService.selectById(id);
    }

    @PostMapping("/saveData")
    public void saveData(@RequestBody UserInfo userInfo) {
        userInfoService.saveData(userInfo);
    }

    @GetMapping("/selectList")
    public List<UserInfo> selectList() {
        return userInfoService.selectList();
    }

    @GetMapping("/selectListByPage")
    public Result selectListByPage() {
        return userInfoService.selectListByPage();
    }
}
